{"ast":null,"code":"import _extends from \"@babel/runtime/helpers/esm/extends\";\nimport _defineProperty from \"@babel/runtime/helpers/esm/defineProperty\";\nimport _objectSpread from \"@babel/runtime/helpers/esm/objectSpread2\";\nimport _toConsumableArray from \"@babel/runtime/helpers/esm/toConsumableArray\";\nimport _slicedToArray from \"@babel/runtime/helpers/esm/slicedToArray\";\nimport _objectWithoutProperties from \"@babel/runtime/helpers/esm/objectWithoutProperties\";\nvar _excluded = [\"prefixCls\", \"rootClassName\", \"style\", \"className\", \"tabIndex\", \"items\", \"children\", \"direction\", \"id\", \"mode\", \"inlineCollapsed\", \"disabled\", \"disabledOverflow\", \"subMenuOpenDelay\", \"subMenuCloseDelay\", \"forceSubMenuRender\", \"defaultOpenKeys\", \"openKeys\", \"activeKey\", \"defaultActiveFirst\", \"selectable\", \"multiple\", \"defaultSelectedKeys\", \"selectedKeys\", \"onSelect\", \"onDeselect\", \"inlineIndent\", \"motion\", \"defaultMotions\", \"triggerSubMenuAction\", \"builtinPlacements\", \"itemIcon\", \"expandIcon\", \"overflowedIndicator\", \"overflowedIndicatorPopupClassName\", \"getPopupContainer\", \"onClick\", \"onOpenChange\", \"onKeyDown\", \"openAnimation\", \"openTransitionName\", \"_internalRenderMenuItem\", \"_internalRenderSubMenuItem\"];\nimport classNames from 'classnames';\nimport Overflow from 'rc-overflow';\nimport useMergedState from \"rc-util/es/hooks/useMergedState\";\nimport warning from \"rc-util/es/warning\";\nimport * as React from 'react';\nimport { useImperativeHandle } from 'react';\nimport { flushSync } from 'react-dom';\nimport shallowEqual from 'shallowequal';\nimport { getMenuId, IdContext } from \"./context/IdContext\";\nimport MenuContextProvider from \"./context/MenuContext\";\nimport { PathRegisterContext, PathUserContext } from \"./context/PathContext\";\nimport PrivateContext from \"./context/PrivateContext\";\nimport useAccessibility from \"./hooks/useAccessibility\";\nimport useKeyRecords, { OVERFLOW_KEY } from \"./hooks/useKeyRecords\";\nimport useMemoCallback from \"./hooks/useMemoCallback\";\nimport useUUID from \"./hooks/useUUID\";\nimport MenuItem from \"./MenuItem\";\nimport SubMenu from \"./SubMenu\";\nimport { parseItems } from \"./utils/nodeUtil\";\nimport { warnItemProp } from \"./utils/warnUtil\";\n/**\n * Menu modify after refactor:\n * ## Add\n * - disabled\n *\n * ## Remove\n * - openTransitionName\n * - openAnimation\n * - onDestroy\n * - siderCollapsed: Seems antd do not use this prop (Need test in antd)\n * - collapsedWidth: Seems this logic should be handle by antd Layout.Sider\n */\n// optimize for render\n\nvar EMPTY_LIST = [];\nvar Menu = /*#__PURE__*/React.forwardRef(function (props, ref) {\n  var _childList$, _classNames;\n  var _ref = props,\n    _ref$prefixCls = _ref.prefixCls,\n    prefixCls = _ref$prefixCls === void 0 ? 'rc-menu' : _ref$prefixCls,\n    rootClassName = _ref.rootClassName,\n    style = _ref.style,\n    className = _ref.className,\n    _ref$tabIndex = _ref.tabIndex,\n    tabIndex = _ref$tabIndex === void 0 ? 0 : _ref$tabIndex,\n    items = _ref.items,\n    children = _ref.children,\n    direction = _ref.direction,\n    id = _ref.id,\n    _ref$mode = _ref.mode,\n    mode = _ref$mode === void 0 ? 'vertical' : _ref$mode,\n    inlineCollapsed = _ref.inlineCollapsed,\n    disabled = _ref.disabled,\n    disabledOverflow = _ref.disabledOverflow,\n    _ref$subMenuOpenDelay = _ref.subMenuOpenDelay,\n    subMenuOpenDelay = _ref$subMenuOpenDelay === void 0 ? 0.1 : _ref$subMenuOpenDelay,\n    _ref$subMenuCloseDela = _ref.subMenuCloseDelay,\n    subMenuCloseDelay = _ref$subMenuCloseDela === void 0 ? 0.1 : _ref$subMenuCloseDela,\n    forceSubMenuRender = _ref.forceSubMenuRender,\n    defaultOpenKeys = _ref.defaultOpenKeys,\n    openKeys = _ref.openKeys,\n    activeKey = _ref.activeKey,\n    defaultActiveFirst = _ref.defaultActiveFirst,\n    _ref$selectable = _ref.selectable,\n    selectable = _ref$selectable === void 0 ? true : _ref$selectable,\n    _ref$multiple = _ref.multiple,\n    multiple = _ref$multiple === void 0 ? false : _ref$multiple,\n    defaultSelectedKeys = _ref.defaultSelectedKeys,\n    selectedKeys = _ref.selectedKeys,\n    onSelect = _ref.onSelect,\n    onDeselect = _ref.onDeselect,\n    _ref$inlineIndent = _ref.inlineIndent,\n    inlineIndent = _ref$inlineIndent === void 0 ? 24 : _ref$inlineIndent,\n    motion = _ref.motion,\n    defaultMotions = _ref.defaultMotions,\n    _ref$triggerSubMenuAc = _ref.triggerSubMenuAction,\n    triggerSubMenuAction = _ref$triggerSubMenuAc === void 0 ? 'hover' : _ref$triggerSubMenuAc,\n    builtinPlacements = _ref.builtinPlacements,\n    itemIcon = _ref.itemIcon,\n    expandIcon = _ref.expandIcon,\n    _ref$overflowedIndica = _ref.overflowedIndicator,\n    overflowedIndicator = _ref$overflowedIndica === void 0 ? '...' : _ref$overflowedIndica,\n    overflowedIndicatorPopupClassName = _ref.overflowedIndicatorPopupClassName,\n    getPopupContainer = _ref.getPopupContainer,\n    onClick = _ref.onClick,\n    onOpenChange = _ref.onOpenChange,\n    onKeyDown = _ref.onKeyDown,\n    openAnimation = _ref.openAnimation,\n    openTransitionName = _ref.openTransitionName,\n    _internalRenderMenuItem = _ref._internalRenderMenuItem,\n    _internalRenderSubMenuItem = _ref._internalRenderSubMenuItem,\n    restProps = _objectWithoutProperties(_ref, _excluded);\n  var childList = React.useMemo(function () {\n    return parseItems(children, items, EMPTY_LIST);\n  }, [children, items]);\n  var _React$useState = React.useState(false),\n    _React$useState2 = _slicedToArray(_React$useState, 2),\n    mounted = _React$useState2[0],\n    setMounted = _React$useState2[1];\n  var containerRef = React.useRef();\n  var uuid = useUUID(id);\n  var isRtl = direction === 'rtl'; // ========================= Warn =========================\n\n  if (process.env.NODE_ENV !== 'production') {\n    warning(!openAnimation && !openTransitionName, '`openAnimation` and `openTransitionName` is removed. Please use `motion` or `defaultMotion` instead.');\n  } // ========================= Open =========================\n\n  var _useMergedState = useMergedState(defaultOpenKeys, {\n      value: openKeys,\n      postState: function postState(keys) {\n        return keys || EMPTY_LIST;\n      }\n    }),\n    _useMergedState2 = _slicedToArray(_useMergedState, 2),\n    mergedOpenKeys = _useMergedState2[0],\n    setMergedOpenKeys = _useMergedState2[1]; // React 18 will merge mouse event which means we open key will not sync\n  // ref: https://github.com/ant-design/ant-design/issues/38818\n\n  var triggerOpenKeys = function triggerOpenKeys(keys) {\n    var forceFlush = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;\n    function doUpdate() {\n      setMergedOpenKeys(keys);\n      onOpenChange === null || onOpenChange === void 0 ? void 0 : onOpenChange(keys);\n    }\n    if (forceFlush) {\n      flushSync(doUpdate);\n    } else {\n      doUpdate();\n    }\n  }; // >>>>> Cache & Reset open keys when inlineCollapsed changed\n\n  var _React$useState3 = React.useState(mergedOpenKeys),\n    _React$useState4 = _slicedToArray(_React$useState3, 2),\n    inlineCacheOpenKeys = _React$useState4[0],\n    setInlineCacheOpenKeys = _React$useState4[1];\n  var mountRef = React.useRef(false); // ========================= Mode =========================\n\n  var _React$useMemo = React.useMemo(function () {\n      if ((mode === 'inline' || mode === 'vertical') && inlineCollapsed) {\n        return ['vertical', inlineCollapsed];\n      }\n      return [mode, false];\n    }, [mode, inlineCollapsed]),\n    _React$useMemo2 = _slicedToArray(_React$useMemo, 2),\n    mergedMode = _React$useMemo2[0],\n    mergedInlineCollapsed = _React$useMemo2[1];\n  var isInlineMode = mergedMode === 'inline';\n  var _React$useState5 = React.useState(mergedMode),\n    _React$useState6 = _slicedToArray(_React$useState5, 2),\n    internalMode = _React$useState6[0],\n    setInternalMode = _React$useState6[1];\n  var _React$useState7 = React.useState(mergedInlineCollapsed),\n    _React$useState8 = _slicedToArray(_React$useState7, 2),\n    internalInlineCollapsed = _React$useState8[0],\n    setInternalInlineCollapsed = _React$useState8[1];\n  React.useEffect(function () {\n    setInternalMode(mergedMode);\n    setInternalInlineCollapsed(mergedInlineCollapsed);\n    if (!mountRef.current) {\n      return;\n    } // Synchronously update MergedOpenKeys\n\n    if (isInlineMode) {\n      setMergedOpenKeys(inlineCacheOpenKeys);\n    } else {\n      // Trigger open event in case its in control\n      triggerOpenKeys(EMPTY_LIST);\n    }\n  }, [mergedMode, mergedInlineCollapsed]); // ====================== Responsive ======================\n\n  var _React$useState9 = React.useState(0),\n    _React$useState10 = _slicedToArray(_React$useState9, 2),\n    lastVisibleIndex = _React$useState10[0],\n    setLastVisibleIndex = _React$useState10[1];\n  var allVisible = lastVisibleIndex >= childList.length - 1 || internalMode !== 'horizontal' || disabledOverflow; // Cache\n\n  React.useEffect(function () {\n    if (isInlineMode) {\n      setInlineCacheOpenKeys(mergedOpenKeys);\n    }\n  }, [mergedOpenKeys]);\n  React.useEffect(function () {\n    mountRef.current = true;\n    return function () {\n      mountRef.current = false;\n    };\n  }, []); // ========================= Path =========================\n\n  var _useKeyRecords = useKeyRecords(),\n    registerPath = _useKeyRecords.registerPath,\n    unregisterPath = _useKeyRecords.unregisterPath,\n    refreshOverflowKeys = _useKeyRecords.refreshOverflowKeys,\n    isSubPathKey = _useKeyRecords.isSubPathKey,\n    getKeyPath = _useKeyRecords.getKeyPath,\n    getKeys = _useKeyRecords.getKeys,\n    getSubPathKeys = _useKeyRecords.getSubPathKeys;\n  var registerPathContext = React.useMemo(function () {\n    return {\n      registerPath: registerPath,\n      unregisterPath: unregisterPath\n    };\n  }, [registerPath, unregisterPath]);\n  var pathUserContext = React.useMemo(function () {\n    return {\n      isSubPathKey: isSubPathKey\n    };\n  }, [isSubPathKey]);\n  React.useEffect(function () {\n    refreshOverflowKeys(allVisible ? EMPTY_LIST : childList.slice(lastVisibleIndex + 1).map(function (child) {\n      return child.key;\n    }));\n  }, [lastVisibleIndex, allVisible]); // ======================== Active ========================\n\n  var _useMergedState3 = useMergedState(activeKey || defaultActiveFirst && ((_childList$ = childList[0]) === null || _childList$ === void 0 ? void 0 : _childList$.key), {\n      value: activeKey\n    }),\n    _useMergedState4 = _slicedToArray(_useMergedState3, 2),\n    mergedActiveKey = _useMergedState4[0],\n    setMergedActiveKey = _useMergedState4[1];\n  var onActive = useMemoCallback(function (key) {\n    setMergedActiveKey(key);\n  });\n  var onInactive = useMemoCallback(function () {\n    setMergedActiveKey(undefined);\n  });\n  useImperativeHandle(ref, function () {\n    return {\n      list: containerRef.current,\n      focus: function focus(options) {\n        var _childList$find;\n        var shouldFocusKey = mergedActiveKey !== null && mergedActiveKey !== void 0 ? mergedActiveKey : (_childList$find = childList.find(function (node) {\n          return !node.props.disabled;\n        })) === null || _childList$find === void 0 ? void 0 : _childList$find.key;\n        if (shouldFocusKey) {\n          var _containerRef$current, _containerRef$current2, _containerRef$current3;\n          (_containerRef$current = containerRef.current) === null || _containerRef$current === void 0 ? void 0 : (_containerRef$current2 = _containerRef$current.querySelector(\"li[data-menu-id='\".concat(getMenuId(uuid, shouldFocusKey), \"']\"))) === null || _containerRef$current2 === void 0 ? void 0 : (_containerRef$current3 = _containerRef$current2.focus) === null || _containerRef$current3 === void 0 ? void 0 : _containerRef$current3.call(_containerRef$current2, options);\n        }\n      }\n    };\n  }); // ======================== Select ========================\n  // >>>>> Select keys\n\n  var _useMergedState5 = useMergedState(defaultSelectedKeys || [], {\n      value: selectedKeys,\n      // Legacy convert key to array\n      postState: function postState(keys) {\n        if (Array.isArray(keys)) {\n          return keys;\n        }\n        if (keys === null || keys === undefined) {\n          return EMPTY_LIST;\n        }\n        return [keys];\n      }\n    }),\n    _useMergedState6 = _slicedToArray(_useMergedState5, 2),\n    mergedSelectKeys = _useMergedState6[0],\n    setMergedSelectKeys = _useMergedState6[1]; // >>>>> Trigger select\n\n  var triggerSelection = function triggerSelection(info) {\n    if (selectable) {\n      // Insert or Remove\n      var targetKey = info.key;\n      var exist = mergedSelectKeys.includes(targetKey);\n      var newSelectKeys;\n      if (multiple) {\n        if (exist) {\n          newSelectKeys = mergedSelectKeys.filter(function (key) {\n            return key !== targetKey;\n          });\n        } else {\n          newSelectKeys = [].concat(_toConsumableArray(mergedSelectKeys), [targetKey]);\n        }\n      } else {\n        newSelectKeys = [targetKey];\n      }\n      setMergedSelectKeys(newSelectKeys); // Trigger event\n\n      var selectInfo = _objectSpread(_objectSpread({}, info), {}, {\n        selectedKeys: newSelectKeys\n      });\n      if (exist) {\n        onDeselect === null || onDeselect === void 0 ? void 0 : onDeselect(selectInfo);\n      } else {\n        onSelect === null || onSelect === void 0 ? void 0 : onSelect(selectInfo);\n      }\n    } // Whatever selectable, always close it\n\n    if (!multiple && mergedOpenKeys.length && internalMode !== 'inline') {\n      triggerOpenKeys(EMPTY_LIST);\n    }\n  }; // ========================= Open =========================\n\n  /**\n   * Click for item. SubMenu do not have selection status\n   */\n\n  var onInternalClick = useMemoCallback(function (info) {\n    onClick === null || onClick === void 0 ? void 0 : onClick(warnItemProp(info));\n    triggerSelection(info);\n  });\n  var onInternalOpenChange = useMemoCallback(function (key, open) {\n    var newOpenKeys = mergedOpenKeys.filter(function (k) {\n      return k !== key;\n    });\n    if (open) {\n      newOpenKeys.push(key);\n    } else if (internalMode !== 'inline') {\n      // We need find all related popup to close\n      var subPathKeys = getSubPathKeys(key);\n      newOpenKeys = newOpenKeys.filter(function (k) {\n        return !subPathKeys.has(k);\n      });\n    }\n    if (!shallowEqual(mergedOpenKeys, newOpenKeys)) {\n      triggerOpenKeys(newOpenKeys, true);\n    }\n  });\n  var getInternalPopupContainer = useMemoCallback(getPopupContainer); // ==================== Accessibility =====================\n\n  var triggerAccessibilityOpen = function triggerAccessibilityOpen(key, open) {\n    var nextOpen = open !== null && open !== void 0 ? open : !mergedOpenKeys.includes(key);\n    onInternalOpenChange(key, nextOpen);\n  };\n  var onInternalKeyDown = useAccessibility(internalMode, mergedActiveKey, isRtl, uuid, containerRef, getKeys, getKeyPath, setMergedActiveKey, triggerAccessibilityOpen, onKeyDown); // ======================== Effect ========================\n\n  React.useEffect(function () {\n    setMounted(true);\n  }, []); // ======================= Context ========================\n\n  var privateContext = React.useMemo(function () {\n    return {\n      _internalRenderMenuItem: _internalRenderMenuItem,\n      _internalRenderSubMenuItem: _internalRenderSubMenuItem\n    };\n  }, [_internalRenderMenuItem, _internalRenderSubMenuItem]); // ======================== Render ========================\n  // >>>>> Children\n\n  var wrappedChildList = internalMode !== 'horizontal' || disabledOverflow ? childList :\n  // Need wrap for overflow dropdown that do not response for open\n  childList.map(function (child, index) {\n    return /*#__PURE__*/(\n      // Always wrap provider to avoid sub node re-mount\n      React.createElement(MenuContextProvider, {\n        key: child.key,\n        overflowDisabled: index > lastVisibleIndex\n      }, child)\n    );\n  }); // >>>>> Container\n\n  var container = /*#__PURE__*/React.createElement(Overflow, _extends({\n    id: id,\n    ref: containerRef,\n    prefixCls: \"\".concat(prefixCls, \"-overflow\"),\n    component: \"ul\",\n    itemComponent: MenuItem,\n    className: classNames(prefixCls, \"\".concat(prefixCls, \"-root\"), \"\".concat(prefixCls, \"-\").concat(internalMode), className, (_classNames = {}, _defineProperty(_classNames, \"\".concat(prefixCls, \"-inline-collapsed\"), internalInlineCollapsed), _defineProperty(_classNames, \"\".concat(prefixCls, \"-rtl\"), isRtl), _classNames), rootClassName),\n    dir: direction,\n    style: style,\n    role: \"menu\",\n    tabIndex: tabIndex,\n    data: wrappedChildList,\n    renderRawItem: function renderRawItem(node) {\n      return node;\n    },\n    renderRawRest: function renderRawRest(omitItems) {\n      // We use origin list since wrapped list use context to prevent open\n      var len = omitItems.length;\n      var originOmitItems = len ? childList.slice(-len) : null;\n      return /*#__PURE__*/React.createElement(SubMenu, {\n        eventKey: OVERFLOW_KEY,\n        title: overflowedIndicator,\n        disabled: allVisible,\n        internalPopupClose: len === 0,\n        popupClassName: overflowedIndicatorPopupClassName\n      }, originOmitItems);\n    },\n    maxCount: internalMode !== 'horizontal' || disabledOverflow ? Overflow.INVALIDATE : Overflow.RESPONSIVE,\n    ssr: \"full\",\n    \"data-menu-list\": true,\n    onVisibleChange: function onVisibleChange(newLastIndex) {\n      setLastVisibleIndex(newLastIndex);\n    },\n    onKeyDown: onInternalKeyDown\n  }, restProps)); // >>>>> Render\n\n  return /*#__PURE__*/React.createElement(PrivateContext.Provider, {\n    value: privateContext\n  }, /*#__PURE__*/React.createElement(IdContext.Provider, {\n    value: uuid\n  }, /*#__PURE__*/React.createElement(MenuContextProvider, {\n    prefixCls: prefixCls,\n    rootClassName: rootClassName,\n    mode: internalMode,\n    openKeys: mergedOpenKeys,\n    rtl: isRtl // Disabled\n    ,\n\n    disabled: disabled // Motion\n    ,\n\n    motion: mounted ? motion : null,\n    defaultMotions: mounted ? defaultMotions : null // Active\n    ,\n\n    activeKey: mergedActiveKey,\n    onActive: onActive,\n    onInactive: onInactive // Selection\n    ,\n\n    selectedKeys: mergedSelectKeys // Level\n    ,\n\n    inlineIndent: inlineIndent // Popup\n    ,\n\n    subMenuOpenDelay: subMenuOpenDelay,\n    subMenuCloseDelay: subMenuCloseDelay,\n    forceSubMenuRender: forceSubMenuRender,\n    builtinPlacements: builtinPlacements,\n    triggerSubMenuAction: triggerSubMenuAction,\n    getPopupContainer: getInternalPopupContainer // Icon\n    ,\n\n    itemIcon: itemIcon,\n    expandIcon: expandIcon // Events\n    ,\n\n    onItemClick: onInternalClick,\n    onOpenChange: onInternalOpenChange\n  }, /*#__PURE__*/React.createElement(PathUserContext.Provider, {\n    value: pathUserContext\n  }, container), /*#__PURE__*/React.createElement(\"div\", {\n    style: {\n      display: 'none'\n    },\n    \"aria-hidden\": true\n  }, /*#__PURE__*/React.createElement(PathRegisterContext.Provider, {\n    value: registerPathContext\n  }, childList)))));\n});\nexport default Menu;","map":{"version":3,"names":["_extends","_defineProperty","_objectSpread","_toConsumableArray","_slicedToArray","_objectWithoutProperties","_excluded","classNames","Overflow","useMergedState","warning","React","useImperativeHandle","flushSync","shallowEqual","getMenuId","IdContext","MenuContextProvider","PathRegisterContext","PathUserContext","PrivateContext","useAccessibility","useKeyRecords","OVERFLOW_KEY","useMemoCallback","useUUID","MenuItem","SubMenu","parseItems","warnItemProp","EMPTY_LIST","Menu","forwardRef","props","ref","_childList$","_classNames","_ref","_ref$prefixCls","prefixCls","rootClassName","style","className","_ref$tabIndex","tabIndex","items","children","direction","id","_ref$mode","mode","inlineCollapsed","disabled","disabledOverflow","_ref$subMenuOpenDelay","subMenuOpenDelay","_ref$subMenuCloseDela","subMenuCloseDelay","forceSubMenuRender","defaultOpenKeys","openKeys","activeKey","defaultActiveFirst","_ref$selectable","selectable","_ref$multiple","multiple","defaultSelectedKeys","selectedKeys","onSelect","onDeselect","_ref$inlineIndent","inlineIndent","motion","defaultMotions","_ref$triggerSubMenuAc","triggerSubMenuAction","builtinPlacements","itemIcon","expandIcon","_ref$overflowedIndica","overflowedIndicator","overflowedIndicatorPopupClassName","getPopupContainer","onClick","onOpenChange","onKeyDown","openAnimation","openTransitionName","_internalRenderMenuItem","_internalRenderSubMenuItem","restProps","childList","useMemo","_React$useState","useState","_React$useState2","mounted","setMounted","containerRef","useRef","uuid","isRtl","process","env","NODE_ENV","_useMergedState","value","postState","keys","_useMergedState2","mergedOpenKeys","setMergedOpenKeys","triggerOpenKeys","forceFlush","arguments","length","undefined","doUpdate","_React$useState3","_React$useState4","inlineCacheOpenKeys","setInlineCacheOpenKeys","mountRef","_React$useMemo","_React$useMemo2","mergedMode","mergedInlineCollapsed","isInlineMode","_React$useState5","_React$useState6","internalMode","setInternalMode","_React$useState7","_React$useState8","internalInlineCollapsed","setInternalInlineCollapsed","useEffect","current","_React$useState9","_React$useState10","lastVisibleIndex","setLastVisibleIndex","allVisible","_useKeyRecords","registerPath","unregisterPath","refreshOverflowKeys","isSubPathKey","getKeyPath","getKeys","getSubPathKeys","registerPathContext","pathUserContext","slice","map","child","key","_useMergedState3","_useMergedState4","mergedActiveKey","setMergedActiveKey","onActive","onInactive","list","focus","options","_childList$find","shouldFocusKey","find","node","_containerRef$current","_containerRef$current2","_containerRef$current3","querySelector","concat","call","_useMergedState5","Array","isArray","_useMergedState6","mergedSelectKeys","setMergedSelectKeys","triggerSelection","info","targetKey","exist","includes","newSelectKeys","filter","selectInfo","onInternalClick","onInternalOpenChange","open","newOpenKeys","k","push","subPathKeys","has","getInternalPopupContainer","triggerAccessibilityOpen","nextOpen","onInternalKeyDown","privateContext","wrappedChildList","index","createElement","overflowDisabled","container","component","itemComponent","dir","role","data","renderRawItem","renderRawRest","omitItems","len","originOmitItems","eventKey","title","internalPopupClose","popupClassName","maxCount","INVALIDATE","RESPONSIVE","ssr","onVisibleChange","newLastIndex","Provider","rtl","onItemClick","display"],"sources":["/Users/poppie/Desktop/development/messenger/app/frontend/node_modules/rc-menu/es/Menu.js"],"sourcesContent":["import _extends from \"@babel/runtime/helpers/esm/extends\";\nimport _defineProperty from \"@babel/runtime/helpers/esm/defineProperty\";\nimport _objectSpread from \"@babel/runtime/helpers/esm/objectSpread2\";\nimport _toConsumableArray from \"@babel/runtime/helpers/esm/toConsumableArray\";\nimport _slicedToArray from \"@babel/runtime/helpers/esm/slicedToArray\";\nimport _objectWithoutProperties from \"@babel/runtime/helpers/esm/objectWithoutProperties\";\nvar _excluded = [\"prefixCls\", \"rootClassName\", \"style\", \"className\", \"tabIndex\", \"items\", \"children\", \"direction\", \"id\", \"mode\", \"inlineCollapsed\", \"disabled\", \"disabledOverflow\", \"subMenuOpenDelay\", \"subMenuCloseDelay\", \"forceSubMenuRender\", \"defaultOpenKeys\", \"openKeys\", \"activeKey\", \"defaultActiveFirst\", \"selectable\", \"multiple\", \"defaultSelectedKeys\", \"selectedKeys\", \"onSelect\", \"onDeselect\", \"inlineIndent\", \"motion\", \"defaultMotions\", \"triggerSubMenuAction\", \"builtinPlacements\", \"itemIcon\", \"expandIcon\", \"overflowedIndicator\", \"overflowedIndicatorPopupClassName\", \"getPopupContainer\", \"onClick\", \"onOpenChange\", \"onKeyDown\", \"openAnimation\", \"openTransitionName\", \"_internalRenderMenuItem\", \"_internalRenderSubMenuItem\"];\nimport classNames from 'classnames';\nimport Overflow from 'rc-overflow';\nimport useMergedState from \"rc-util/es/hooks/useMergedState\";\nimport warning from \"rc-util/es/warning\";\nimport * as React from 'react';\nimport { useImperativeHandle } from 'react';\nimport { flushSync } from 'react-dom';\nimport shallowEqual from 'shallowequal';\nimport { getMenuId, IdContext } from \"./context/IdContext\";\nimport MenuContextProvider from \"./context/MenuContext\";\nimport { PathRegisterContext, PathUserContext } from \"./context/PathContext\";\nimport PrivateContext from \"./context/PrivateContext\";\nimport useAccessibility from \"./hooks/useAccessibility\";\nimport useKeyRecords, { OVERFLOW_KEY } from \"./hooks/useKeyRecords\";\nimport useMemoCallback from \"./hooks/useMemoCallback\";\nimport useUUID from \"./hooks/useUUID\";\nimport MenuItem from \"./MenuItem\";\nimport SubMenu from \"./SubMenu\";\nimport { parseItems } from \"./utils/nodeUtil\";\nimport { warnItemProp } from \"./utils/warnUtil\";\n/**\n * Menu modify after refactor:\n * ## Add\n * - disabled\n *\n * ## Remove\n * - openTransitionName\n * - openAnimation\n * - onDestroy\n * - siderCollapsed: Seems antd do not use this prop (Need test in antd)\n * - collapsedWidth: Seems this logic should be handle by antd Layout.Sider\n */\n// optimize for render\n\nvar EMPTY_LIST = [];\nvar Menu = /*#__PURE__*/React.forwardRef(function (props, ref) {\n  var _childList$, _classNames;\n\n  var _ref = props,\n      _ref$prefixCls = _ref.prefixCls,\n      prefixCls = _ref$prefixCls === void 0 ? 'rc-menu' : _ref$prefixCls,\n      rootClassName = _ref.rootClassName,\n      style = _ref.style,\n      className = _ref.className,\n      _ref$tabIndex = _ref.tabIndex,\n      tabIndex = _ref$tabIndex === void 0 ? 0 : _ref$tabIndex,\n      items = _ref.items,\n      children = _ref.children,\n      direction = _ref.direction,\n      id = _ref.id,\n      _ref$mode = _ref.mode,\n      mode = _ref$mode === void 0 ? 'vertical' : _ref$mode,\n      inlineCollapsed = _ref.inlineCollapsed,\n      disabled = _ref.disabled,\n      disabledOverflow = _ref.disabledOverflow,\n      _ref$subMenuOpenDelay = _ref.subMenuOpenDelay,\n      subMenuOpenDelay = _ref$subMenuOpenDelay === void 0 ? 0.1 : _ref$subMenuOpenDelay,\n      _ref$subMenuCloseDela = _ref.subMenuCloseDelay,\n      subMenuCloseDelay = _ref$subMenuCloseDela === void 0 ? 0.1 : _ref$subMenuCloseDela,\n      forceSubMenuRender = _ref.forceSubMenuRender,\n      defaultOpenKeys = _ref.defaultOpenKeys,\n      openKeys = _ref.openKeys,\n      activeKey = _ref.activeKey,\n      defaultActiveFirst = _ref.defaultActiveFirst,\n      _ref$selectable = _ref.selectable,\n      selectable = _ref$selectable === void 0 ? true : _ref$selectable,\n      _ref$multiple = _ref.multiple,\n      multiple = _ref$multiple === void 0 ? false : _ref$multiple,\n      defaultSelectedKeys = _ref.defaultSelectedKeys,\n      selectedKeys = _ref.selectedKeys,\n      onSelect = _ref.onSelect,\n      onDeselect = _ref.onDeselect,\n      _ref$inlineIndent = _ref.inlineIndent,\n      inlineIndent = _ref$inlineIndent === void 0 ? 24 : _ref$inlineIndent,\n      motion = _ref.motion,\n      defaultMotions = _ref.defaultMotions,\n      _ref$triggerSubMenuAc = _ref.triggerSubMenuAction,\n      triggerSubMenuAction = _ref$triggerSubMenuAc === void 0 ? 'hover' : _ref$triggerSubMenuAc,\n      builtinPlacements = _ref.builtinPlacements,\n      itemIcon = _ref.itemIcon,\n      expandIcon = _ref.expandIcon,\n      _ref$overflowedIndica = _ref.overflowedIndicator,\n      overflowedIndicator = _ref$overflowedIndica === void 0 ? '...' : _ref$overflowedIndica,\n      overflowedIndicatorPopupClassName = _ref.overflowedIndicatorPopupClassName,\n      getPopupContainer = _ref.getPopupContainer,\n      onClick = _ref.onClick,\n      onOpenChange = _ref.onOpenChange,\n      onKeyDown = _ref.onKeyDown,\n      openAnimation = _ref.openAnimation,\n      openTransitionName = _ref.openTransitionName,\n      _internalRenderMenuItem = _ref._internalRenderMenuItem,\n      _internalRenderSubMenuItem = _ref._internalRenderSubMenuItem,\n      restProps = _objectWithoutProperties(_ref, _excluded);\n\n  var childList = React.useMemo(function () {\n    return parseItems(children, items, EMPTY_LIST);\n  }, [children, items]);\n\n  var _React$useState = React.useState(false),\n      _React$useState2 = _slicedToArray(_React$useState, 2),\n      mounted = _React$useState2[0],\n      setMounted = _React$useState2[1];\n\n  var containerRef = React.useRef();\n  var uuid = useUUID(id);\n  var isRtl = direction === 'rtl'; // ========================= Warn =========================\n\n  if (process.env.NODE_ENV !== 'production') {\n    warning(!openAnimation && !openTransitionName, '`openAnimation` and `openTransitionName` is removed. Please use `motion` or `defaultMotion` instead.');\n  } // ========================= Open =========================\n\n\n  var _useMergedState = useMergedState(defaultOpenKeys, {\n    value: openKeys,\n    postState: function postState(keys) {\n      return keys || EMPTY_LIST;\n    }\n  }),\n      _useMergedState2 = _slicedToArray(_useMergedState, 2),\n      mergedOpenKeys = _useMergedState2[0],\n      setMergedOpenKeys = _useMergedState2[1]; // React 18 will merge mouse event which means we open key will not sync\n  // ref: https://github.com/ant-design/ant-design/issues/38818\n\n\n  var triggerOpenKeys = function triggerOpenKeys(keys) {\n    var forceFlush = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;\n\n    function doUpdate() {\n      setMergedOpenKeys(keys);\n      onOpenChange === null || onOpenChange === void 0 ? void 0 : onOpenChange(keys);\n    }\n\n    if (forceFlush) {\n      flushSync(doUpdate);\n    } else {\n      doUpdate();\n    }\n  }; // >>>>> Cache & Reset open keys when inlineCollapsed changed\n\n\n  var _React$useState3 = React.useState(mergedOpenKeys),\n      _React$useState4 = _slicedToArray(_React$useState3, 2),\n      inlineCacheOpenKeys = _React$useState4[0],\n      setInlineCacheOpenKeys = _React$useState4[1];\n\n  var mountRef = React.useRef(false); // ========================= Mode =========================\n\n  var _React$useMemo = React.useMemo(function () {\n    if ((mode === 'inline' || mode === 'vertical') && inlineCollapsed) {\n      return ['vertical', inlineCollapsed];\n    }\n\n    return [mode, false];\n  }, [mode, inlineCollapsed]),\n      _React$useMemo2 = _slicedToArray(_React$useMemo, 2),\n      mergedMode = _React$useMemo2[0],\n      mergedInlineCollapsed = _React$useMemo2[1];\n\n  var isInlineMode = mergedMode === 'inline';\n\n  var _React$useState5 = React.useState(mergedMode),\n      _React$useState6 = _slicedToArray(_React$useState5, 2),\n      internalMode = _React$useState6[0],\n      setInternalMode = _React$useState6[1];\n\n  var _React$useState7 = React.useState(mergedInlineCollapsed),\n      _React$useState8 = _slicedToArray(_React$useState7, 2),\n      internalInlineCollapsed = _React$useState8[0],\n      setInternalInlineCollapsed = _React$useState8[1];\n\n  React.useEffect(function () {\n    setInternalMode(mergedMode);\n    setInternalInlineCollapsed(mergedInlineCollapsed);\n\n    if (!mountRef.current) {\n      return;\n    } // Synchronously update MergedOpenKeys\n\n\n    if (isInlineMode) {\n      setMergedOpenKeys(inlineCacheOpenKeys);\n    } else {\n      // Trigger open event in case its in control\n      triggerOpenKeys(EMPTY_LIST);\n    }\n  }, [mergedMode, mergedInlineCollapsed]); // ====================== Responsive ======================\n\n  var _React$useState9 = React.useState(0),\n      _React$useState10 = _slicedToArray(_React$useState9, 2),\n      lastVisibleIndex = _React$useState10[0],\n      setLastVisibleIndex = _React$useState10[1];\n\n  var allVisible = lastVisibleIndex >= childList.length - 1 || internalMode !== 'horizontal' || disabledOverflow; // Cache\n\n  React.useEffect(function () {\n    if (isInlineMode) {\n      setInlineCacheOpenKeys(mergedOpenKeys);\n    }\n  }, [mergedOpenKeys]);\n  React.useEffect(function () {\n    mountRef.current = true;\n    return function () {\n      mountRef.current = false;\n    };\n  }, []); // ========================= Path =========================\n\n  var _useKeyRecords = useKeyRecords(),\n      registerPath = _useKeyRecords.registerPath,\n      unregisterPath = _useKeyRecords.unregisterPath,\n      refreshOverflowKeys = _useKeyRecords.refreshOverflowKeys,\n      isSubPathKey = _useKeyRecords.isSubPathKey,\n      getKeyPath = _useKeyRecords.getKeyPath,\n      getKeys = _useKeyRecords.getKeys,\n      getSubPathKeys = _useKeyRecords.getSubPathKeys;\n\n  var registerPathContext = React.useMemo(function () {\n    return {\n      registerPath: registerPath,\n      unregisterPath: unregisterPath\n    };\n  }, [registerPath, unregisterPath]);\n  var pathUserContext = React.useMemo(function () {\n    return {\n      isSubPathKey: isSubPathKey\n    };\n  }, [isSubPathKey]);\n  React.useEffect(function () {\n    refreshOverflowKeys(allVisible ? EMPTY_LIST : childList.slice(lastVisibleIndex + 1).map(function (child) {\n      return child.key;\n    }));\n  }, [lastVisibleIndex, allVisible]); // ======================== Active ========================\n\n  var _useMergedState3 = useMergedState(activeKey || defaultActiveFirst && ((_childList$ = childList[0]) === null || _childList$ === void 0 ? void 0 : _childList$.key), {\n    value: activeKey\n  }),\n      _useMergedState4 = _slicedToArray(_useMergedState3, 2),\n      mergedActiveKey = _useMergedState4[0],\n      setMergedActiveKey = _useMergedState4[1];\n\n  var onActive = useMemoCallback(function (key) {\n    setMergedActiveKey(key);\n  });\n  var onInactive = useMemoCallback(function () {\n    setMergedActiveKey(undefined);\n  });\n  useImperativeHandle(ref, function () {\n    return {\n      list: containerRef.current,\n      focus: function focus(options) {\n        var _childList$find;\n\n        var shouldFocusKey = mergedActiveKey !== null && mergedActiveKey !== void 0 ? mergedActiveKey : (_childList$find = childList.find(function (node) {\n          return !node.props.disabled;\n        })) === null || _childList$find === void 0 ? void 0 : _childList$find.key;\n\n        if (shouldFocusKey) {\n          var _containerRef$current, _containerRef$current2, _containerRef$current3;\n\n          (_containerRef$current = containerRef.current) === null || _containerRef$current === void 0 ? void 0 : (_containerRef$current2 = _containerRef$current.querySelector(\"li[data-menu-id='\".concat(getMenuId(uuid, shouldFocusKey), \"']\"))) === null || _containerRef$current2 === void 0 ? void 0 : (_containerRef$current3 = _containerRef$current2.focus) === null || _containerRef$current3 === void 0 ? void 0 : _containerRef$current3.call(_containerRef$current2, options);\n        }\n      }\n    };\n  }); // ======================== Select ========================\n  // >>>>> Select keys\n\n  var _useMergedState5 = useMergedState(defaultSelectedKeys || [], {\n    value: selectedKeys,\n    // Legacy convert key to array\n    postState: function postState(keys) {\n      if (Array.isArray(keys)) {\n        return keys;\n      }\n\n      if (keys === null || keys === undefined) {\n        return EMPTY_LIST;\n      }\n\n      return [keys];\n    }\n  }),\n      _useMergedState6 = _slicedToArray(_useMergedState5, 2),\n      mergedSelectKeys = _useMergedState6[0],\n      setMergedSelectKeys = _useMergedState6[1]; // >>>>> Trigger select\n\n\n  var triggerSelection = function triggerSelection(info) {\n    if (selectable) {\n      // Insert or Remove\n      var targetKey = info.key;\n      var exist = mergedSelectKeys.includes(targetKey);\n      var newSelectKeys;\n\n      if (multiple) {\n        if (exist) {\n          newSelectKeys = mergedSelectKeys.filter(function (key) {\n            return key !== targetKey;\n          });\n        } else {\n          newSelectKeys = [].concat(_toConsumableArray(mergedSelectKeys), [targetKey]);\n        }\n      } else {\n        newSelectKeys = [targetKey];\n      }\n\n      setMergedSelectKeys(newSelectKeys); // Trigger event\n\n      var selectInfo = _objectSpread(_objectSpread({}, info), {}, {\n        selectedKeys: newSelectKeys\n      });\n\n      if (exist) {\n        onDeselect === null || onDeselect === void 0 ? void 0 : onDeselect(selectInfo);\n      } else {\n        onSelect === null || onSelect === void 0 ? void 0 : onSelect(selectInfo);\n      }\n    } // Whatever selectable, always close it\n\n\n    if (!multiple && mergedOpenKeys.length && internalMode !== 'inline') {\n      triggerOpenKeys(EMPTY_LIST);\n    }\n  }; // ========================= Open =========================\n\n  /**\n   * Click for item. SubMenu do not have selection status\n   */\n\n\n  var onInternalClick = useMemoCallback(function (info) {\n    onClick === null || onClick === void 0 ? void 0 : onClick(warnItemProp(info));\n    triggerSelection(info);\n  });\n  var onInternalOpenChange = useMemoCallback(function (key, open) {\n    var newOpenKeys = mergedOpenKeys.filter(function (k) {\n      return k !== key;\n    });\n\n    if (open) {\n      newOpenKeys.push(key);\n    } else if (internalMode !== 'inline') {\n      // We need find all related popup to close\n      var subPathKeys = getSubPathKeys(key);\n      newOpenKeys = newOpenKeys.filter(function (k) {\n        return !subPathKeys.has(k);\n      });\n    }\n\n    if (!shallowEqual(mergedOpenKeys, newOpenKeys)) {\n      triggerOpenKeys(newOpenKeys, true);\n    }\n  });\n  var getInternalPopupContainer = useMemoCallback(getPopupContainer); // ==================== Accessibility =====================\n\n  var triggerAccessibilityOpen = function triggerAccessibilityOpen(key, open) {\n    var nextOpen = open !== null && open !== void 0 ? open : !mergedOpenKeys.includes(key);\n    onInternalOpenChange(key, nextOpen);\n  };\n\n  var onInternalKeyDown = useAccessibility(internalMode, mergedActiveKey, isRtl, uuid, containerRef, getKeys, getKeyPath, setMergedActiveKey, triggerAccessibilityOpen, onKeyDown); // ======================== Effect ========================\n\n  React.useEffect(function () {\n    setMounted(true);\n  }, []); // ======================= Context ========================\n\n  var privateContext = React.useMemo(function () {\n    return {\n      _internalRenderMenuItem: _internalRenderMenuItem,\n      _internalRenderSubMenuItem: _internalRenderSubMenuItem\n    };\n  }, [_internalRenderMenuItem, _internalRenderSubMenuItem]); // ======================== Render ========================\n  // >>>>> Children\n\n  var wrappedChildList = internalMode !== 'horizontal' || disabledOverflow ? childList : // Need wrap for overflow dropdown that do not response for open\n  childList.map(function (child, index) {\n    return (\n      /*#__PURE__*/\n      // Always wrap provider to avoid sub node re-mount\n      React.createElement(MenuContextProvider, {\n        key: child.key,\n        overflowDisabled: index > lastVisibleIndex\n      }, child)\n    );\n  }); // >>>>> Container\n\n  var container = /*#__PURE__*/React.createElement(Overflow, _extends({\n    id: id,\n    ref: containerRef,\n    prefixCls: \"\".concat(prefixCls, \"-overflow\"),\n    component: \"ul\",\n    itemComponent: MenuItem,\n    className: classNames(prefixCls, \"\".concat(prefixCls, \"-root\"), \"\".concat(prefixCls, \"-\").concat(internalMode), className, (_classNames = {}, _defineProperty(_classNames, \"\".concat(prefixCls, \"-inline-collapsed\"), internalInlineCollapsed), _defineProperty(_classNames, \"\".concat(prefixCls, \"-rtl\"), isRtl), _classNames), rootClassName),\n    dir: direction,\n    style: style,\n    role: \"menu\",\n    tabIndex: tabIndex,\n    data: wrappedChildList,\n    renderRawItem: function renderRawItem(node) {\n      return node;\n    },\n    renderRawRest: function renderRawRest(omitItems) {\n      // We use origin list since wrapped list use context to prevent open\n      var len = omitItems.length;\n      var originOmitItems = len ? childList.slice(-len) : null;\n      return /*#__PURE__*/React.createElement(SubMenu, {\n        eventKey: OVERFLOW_KEY,\n        title: overflowedIndicator,\n        disabled: allVisible,\n        internalPopupClose: len === 0,\n        popupClassName: overflowedIndicatorPopupClassName\n      }, originOmitItems);\n    },\n    maxCount: internalMode !== 'horizontal' || disabledOverflow ? Overflow.INVALIDATE : Overflow.RESPONSIVE,\n    ssr: \"full\",\n    \"data-menu-list\": true,\n    onVisibleChange: function onVisibleChange(newLastIndex) {\n      setLastVisibleIndex(newLastIndex);\n    },\n    onKeyDown: onInternalKeyDown\n  }, restProps)); // >>>>> Render\n\n  return /*#__PURE__*/React.createElement(PrivateContext.Provider, {\n    value: privateContext\n  }, /*#__PURE__*/React.createElement(IdContext.Provider, {\n    value: uuid\n  }, /*#__PURE__*/React.createElement(MenuContextProvider, {\n    prefixCls: prefixCls,\n    rootClassName: rootClassName,\n    mode: internalMode,\n    openKeys: mergedOpenKeys,\n    rtl: isRtl // Disabled\n    ,\n    disabled: disabled // Motion\n    ,\n    motion: mounted ? motion : null,\n    defaultMotions: mounted ? defaultMotions : null // Active\n    ,\n    activeKey: mergedActiveKey,\n    onActive: onActive,\n    onInactive: onInactive // Selection\n    ,\n    selectedKeys: mergedSelectKeys // Level\n    ,\n    inlineIndent: inlineIndent // Popup\n    ,\n    subMenuOpenDelay: subMenuOpenDelay,\n    subMenuCloseDelay: subMenuCloseDelay,\n    forceSubMenuRender: forceSubMenuRender,\n    builtinPlacements: builtinPlacements,\n    triggerSubMenuAction: triggerSubMenuAction,\n    getPopupContainer: getInternalPopupContainer // Icon\n    ,\n    itemIcon: itemIcon,\n    expandIcon: expandIcon // Events\n    ,\n    onItemClick: onInternalClick,\n    onOpenChange: onInternalOpenChange\n  }, /*#__PURE__*/React.createElement(PathUserContext.Provider, {\n    value: pathUserContext\n  }, container), /*#__PURE__*/React.createElement(\"div\", {\n    style: {\n      display: 'none'\n    },\n    \"aria-hidden\": true\n  }, /*#__PURE__*/React.createElement(PathReg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